<?php
	/* Functions in this file */
	/**************************/

	// Clear()
	// GetDescription()
	// GetFormattedText()
	// GetLetter()
	// GetMFCClassName()
	// GetMFCClassSchema()
	// IsItSet()
	// IsValidLetter($letter)
	// SetDescription($description)
	// SetLetter($letter)
?>
 
<?php
	 
	 
	class RehearsalSign {
		// Constants
		// Default constants
		const DEFAULT_LETTER = self::notSet;
		const DEFAULT_DESCRIPTION = "";
		 
		 
		const notSet = 0x0000007f;
		 
		protected $m_letter = self::DEFAULT_LETTER;
		protected $m_description = self::DEFAULT_DESCRIPTION;
		 
		 
		// MFC Class Functions
		 
		 
		function GetMFCClassName() {
			return "CRehearsalSign2";
		}
		 
		 
		function GetMFCClassSchema() {
			return 1;
		}
		 
		 
		// Letter Functions
		 
		function IsValidLetter($letter) {
			return ((($letter >= 'A') && ($letter <= 'Z')) || ($letter == self::notSet));
		}
		 
		 
		function GetLetter() {
			return ($this->m_letter);
		}
		 
		// Description functions
		 
		 
		 
		function SetDescription($description) {
			if (!$description != NULL) return 0;
			$this->m_description = $description;
			 return 1;
		}
		 
		 
		function GetDescription() {
			return ($this->m_description);
		}
		 
		// Operations
		 
		 
		function IsItSet() {
			return ($this->GetLetter() != self::notSet);
		}
		 
		function Clear() {
			$this->SetLetter(self::notSet);
			 $this->SetDescription("");
		}
		 
		 
		function RehearsalSign($letter=NULL, $description=NULL) {
			 
			//------Last Checked------//
			// - Dec 10, 2004
			if (!$this->IsValidLetter($letter)) return 0;
			if (!$description != NULL) return 0;
		}
		
		// Serialize Functions
		 
		 
		 
		function DoSerialize(&$stream){
		 
		
			WRITE_INIT8 ($stream,$this->m_letter);

			WRITE_CSTRING ($stream,$this->m_description);

			return 1;
		}
		
		 
		function DoDeserialize(&$stream){
		 
		
			$this->m_letter = READ_INIT8 ($stream);
		 
			$this->m_description = READ_CSTRING ($stream);
		
		}
		 
		// Letter Functions
		
		 
		function SetLetter($letter) {
			 
			//------Last Checked------//
			// - Dec 10, 2004
			if (!$this->IsValidLetter($letter)) return 0;
			$this->m_letter = $letter;
			 
			// If the rehearsal sign is being unset, clear the $description
			if ($letter == self::notSet)
				$this->m_description = '';
			return 1;
		}
		 
		// Operations
		 
		 
		function GetFormattedText() {
			return (sprintf("%c -- %s", $this->GetLetter(), $this->GetDescription()));
		}
		 
		 
	}
	 
?>

